package com.sumainfor.pc.epc.controller.gmio;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.epc.service.impl.gmio.NoRepairOrderService;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 运营部
 * <p>
 *
 * @author: zhoucong
 * @create: 2019-06-08 16:48
 **/
@Controller
@RequestMapping("/key/NoRepairOrder")
public class NoRepairOrderController {

    @Autowired
    NoRepairOrderService noRepairOrderService;

    /**
     * <p>
     * 超过72小时未维修
     * </p>
     *
     * @author: zhoucong
     * @since:
     */
    @ResponseBody
    @GetMapping("/getNoRepairOrderCount")
    public JsonResult getNoRepairOrderCount(@RequestParam Map<String,Object> params) {
        return noRepairOrderService.getNoRepairOrderCount(params);
    }


    /**
     * <p>
     * 待验房
     * </p>
     *
     * @author: zhoucong
     * @since:
     */
    @ResponseBody
    @GetMapping("/getQuarantinedRoomCount")
    public JsonResult getQuarantinedRoomCount(@RequestParam Map<String,Object> params) {
        return noRepairOrderService.getQuarantinedRoomCount(params);
    }


    /**
     * <p>
     * 维修工单跟踪
     * </p>
     *
     * @author: zhoucong
     * @since:
     */
    @ResponseBody
    @GetMapping("/getRepairTracking")
    public JsonResult getRepairTracking(@RequestParam Map<String,Object> params) {
        return noRepairOrderService.getRepairTracking(params);
    }


    /**
     * 装修明细报表
     *
     * @param params
     * @return
     */
    @PostMapping("/getPlanDetailTable")
    @ResponseBody
    public JsonResult getPlanDetailTable(@RequestParam Map<String, Object> params) {
        Page page = new Page(MapUtils.getLongValue(params, "current"), MapUtils.getLongValue(params, "size"));
        return JsonResult.success(noRepairOrderService.getPlanDetailTable(page, params));
    }

    /**
     * 租后主管超72小时未维修
     * @author zhoucong
     * @data 2019/7/3
     * @Param
     * @return
     */
    @ResponseBody
    @GetMapping("/getNoRepairOrderInteger")
    public JsonResult getNoRepairOrderInteger(){
        return noRepairOrderService.getNoRepairOrderInteger();
    }
}
